{% extends 'layout.html' %}

{% load my_tags %}

{% block content %}

    <div>
        <a href="{% url_tag request 'crm:class_add' %}" class="btn btn-primary btn-sm">新增</a>
    </div>

    <table class="table table-bordered table-hover">
        <thead>
        <tr>

            <th>序号</th>
            <th>班级名称</th>
            <th>学费</th>
            <th>开班日期</th>
            <th>结业日期</th>
            <th>班级类型</th>
            <th>老师</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        {% for class in all_class %}
            <tr>

                <td>{{ forloop.counter }}</td>
                <td>{{ class }}</td>
                <td>{{ class.price }}</td>
                <td>{{ class.start_date }}</td>
                <td>{{ class.graduate_date }}</td>

                <td>{{ class.get_class_type_display }}</td>
                <td>{{ class.show_teachers }}</td>
                <td>
                    <a class="btn btn-sm btn-danger"
                       href="{% url_tag request 'crm:class_edit' class.pk %}">编辑</a>
                    <a class="btn btn-sm btn-success"
                       href="{% url_tag request 'crm:course_record_list' class.pk %}">查看课程记录</a>
                </td>

            </tr>
        {% endfor %}

        </tbody>
    </table>
    {#    </form>#}
    <nav aria-label="Page navigation">
        <ul class="pagination">

            {{ page_html }}
        </ul>
    </nav>


{% endblock %}